package customer.mysql.synthe.procedure.mysql.bean;
import java.sql.*;
public class Test {
    public static void main(String[] args) {


                String url = "jdbc:mysql://127.0.0.1:3306/student_store?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8";
                String username = "root";
                String password = "liguojun@0723";

                try {
                    // 加载MySQL驱动程序
                    Class.forName("com.mysql.cj.jdbc.Driver");

                    // 建立数据库连接
                    Connection conn = DriverManager.getConnection(url, username, password);

                    // 创建查询语句
                    String query = " {call calculate_product(1300)}";

                    // 创建Statement对象
                    Statement stmt = conn.createStatement();

                    // 执行查询
                    ResultSet rs = stmt.executeQuery(query);

                    // 处理查询结果
                    System.out.println(rs);
                    // 关闭连接
                    rs.close();
                    stmt.close();
                    conn.close();

                } catch (SQLException | ClassNotFoundException e) {
                    e.printStackTrace();
                }
    }
}
